package monpkg.entities;

import java.io.Serializable;
import java.rmi.Remote;
import java.util.Vector;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
/**
 * @author Yannick Bouchot
 * @author Jonathan Romero
 */
@Entity(name = "Promotion")
@NamedQueries({
	@NamedQuery(name = "findAllPromotions", query = "SELECT p FROM Promotion p")})
public class Promotion implements Serializable, Remote {

    private static final long serialVersionUID = 1L;

	@Id()
	@GeneratedValue(strategy = GenerationType.AUTO)
	private long id;

	@Basic(optional = false)
	@Column(name = "name", length = 200, nullable = false, unique = false)
	private String Name;

	@Basic(optional = false)
	@Column(name = "code", length = 200, nullable = false, unique = false)
	private String code;

	@Basic(optional = false)
	@Column(name = "description", length = 10000, nullable = false, unique = false)
	private String description;

	@Basic(optional = false)
	@Column(name = "date", length = 30, nullable = false, unique = false)
	private String date;
	
	@Basic(optional = true)
	@Column(name = "students", nullable = true, unique = false)
	private Vector<Student> students = new Vector<Student>();
	/**
	 * methode permettant de creer une promotion 
	 */
	public Promotion() {
		super();
	}
/**
 * methode permettant de creer une promotion avec ses parametres
 */
	public Promotion(String Name, String code, String description, String date) {
		super();
		this.Name = Name;
		this.code = code;
		this.description = description;
		this.date = date;
	}

	/**
	 * methode permattant de recuperer l'id de la promotion
	 */
	public long getId() {
		return id;
	}

	/**
	 * methode permattant de definir l'id de la promotion
	 */
	public void setId(long id) {
		this.id = id;
	}
	/**
	 * methode permattant de recuperer le nom de la promotion
	 */
	public String getName() {
		return Name;
	}
	/**
	 * methode permettant de definir le nom de la promotion
	 */
	public void setName(String name) {
		Name = name;
	}
	/**
	 * methode permattant de recuperer le code de la promotion
	 */
	public String getCode() {
		return code;
	}
	/**
	 * methode permettant de definir le code de la promotion
	 */
	public void setCode(String code) {
		this.code = code;
	}
	/**
	 * methode permattant de recuperer la description de la promotion
	 */
	public String getDescription() {
		return description;
	}
	/**
	 * methode permettant de definir la description de la promotion
	 */
	public void setDescription(String description) {
		this.description = description;
	}
	/**
	 * methode permattant de recuperer l'annee de la promotion
	 */
	public String getDate() {
		return date;
	}
	/**
	 * methode permettant de definir l'annee de la promotion
	 */
	public void setDate(String date) {
		this.date = date;
	}
	/**
	 * methode permattant de recuperer la liste des etudiants de la promotion
	 */
	public Vector<Student> getStudents() {
		return students;
	}
	/**
	 * methode permettant de definir la liste des etudiants de la promotion
	 */
	public void setStudents(Vector<Student> students) {
		this.students = students;
	}
}
